Skip to content

Investigate some integration-test failures #2844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 24, 2025

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Feb 24, 2025

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

It's a debugging of an intermittent integration-test failure.

What is the current behavior?

The following test fails:

=== RUN   TestDaemonUserAgent
{
  "IP": "127.0.0.1",
  "Port": "50051"
}
>>> Create() -> instance:{id:1}
>>> Init(instance:{id:1})
INIT> &{download_progress:{start:{url:"https://downloads.arduino.cc/libraries/library_index.tar.bz2"  label:"Downloading index: library_index.tar.bz2"}}}
INIT> &{download_progress:{update:{downloaded:3397585  total_size:3397585}}}
INIT> &{download_progress:{end:{success:true}}}
INIT> &{download_progress:{start:{url:"https://downloads.arduino.cc/packages/package_index.tar.bz2"  label:"Downloading index: package_index.tar.bz2"}}}
INIT> &{download_progress:{update:{downloaded:79774  total_size:79774}}}
INIT> &{download_progress:{end:{success:true}}}
INIT> &{task_progress:{name:"Downloading missing tool builtin:[email protected]"}}
INIT> &{download_progress:{start:{url:"https://downloads.arduino.cc/discovery/dfu-discovery/dfu-discovery_v0.1.2_Windows_64bit.zip"  label:"builtin:[email protected]"}}}
INIT> &{download_progress:{end:{success:true  message:"builtin:[email protected] already downloaded"}}}
INIT> &{task_progress:{completed:true}}
INIT> &{task_progress:{name:"Installing builtin:[email protected]"}}
INIT> &{task_progress:{message:"Skipping tool configuration."}}
INIT> &{task_progress:{message:"builtin:[email protected] installed"  completed:true}}
INIT> &{task_progress:{name:"Downloading missing tool builtin:[email protected]"}}
INIT> &{download_progress:{start:{url:"https://downloads.arduino.cc/discovery/mdns-discovery/mdns-discovery_v1.0.9_Windows_64bit.zip"  label:"builtin:[email protected]"}}}
INIT> &{download_progress:{end:{success:true  message:"builtin:[email protected] already downloaded"}}}
INIT> &{task_progress:{completed:true}}
INIT> &{task_progress:{name:"Installing builtin:[email protected]"}}
INIT> &{task_progress:{message:"Skipping tool configuration."}}
INIT> &{task_progress:{message:"builtin:[email protected] installed"  completed:true}}
INIT> &{task_progress:{name:"Downloading missing tool builtin:[email protected]"}}
INIT> &{download_progress:{start:{url:"https://downloads.arduino.cc/discovery/serial-discovery/serial-discovery_v1.4.1_Windows_64bit.zip"  label:"builtin:[email protected]"}}}
INIT> &{download_progress:{end:{success:true  message:"builtin:[email protected] already downloaded"}}}
INIT> &{task_progress:{completed:true}}
INIT> &{task_progress:{name:"Installing builtin:[email protected]"}}
INIT> &{task_progress:{message:"Skipping tool configuration."}}
INIT> &{task_progress:{message:"builtin:[email protected] installed"  completed:true}}
INIT> &{task_progress:{name:"Downloading missing tool builtin:[email protected]"}}
INIT> &{download_progress:{start:{url:"https://downloads.arduino.cc/monitor/serial-monitor/serial-monitor_v0.14.1_Windows_64bit.zip"  label:"builtin:[email protected]"}}}
INIT> &{download_progress:{end:{success:true  message:"builtin:[email protected] already downloaded"}}}
INIT> &{task_progress:{completed:true}}
INIT> &{task_progress:{name:"Installing builtin:[email protected]"}}
INIT> &{task_progress:{message:"Skipping tool configuration."}}
INIT> &{task_progress:{message:"builtin:[email protected] installed"  completed:true}}
INIT> &{task_progress:{name:"Downloading missing tool builtin:[email protected]"}}
INIT> &{download_progress:{start:{url:"https://downloads.arduino.cc/tools/ctags-5.8-arduino11-pm-i686-mingw32.zip"  label:"builtin:[email protected]"}}}
INIT> &{download_progress:{end:{success:true  message:"builtin:[email protected] already downloaded"}}}
INIT> &{task_progress:{completed:true}}
INIT> &{task_progress:{name:"Installing builtin:[email protected]"}}
INIT> &{task_progress:{message:"Skipping tool configuration."}}
INIT> &{task_progress:{message:"builtin:[email protected] installed"  completed:true}}
<<< Init EOF
>>> SetValue(key:"board_manager.additional_urls"  encoded_value:"[\"[http://127.0.0.1:52938/test_index.json\](http://127.0.0.1:52938/test_index.json/)"]")
>>> UpdateIndex(instance:{id:1})
    daemon_test.go:577: 
        	Error Trace:	D:/a/arduino-cli/arduino-cli/internal/integrationtest/daemon/daemon_test.go:577
        	            				C:/hostedtoolcache/windows/go/1.23.6/x64/src/net/http/server.go:2220
        	            				C:/hostedtoolcache/windows/go/1.23.6/x64/src/net/http/server.go:3210
        	            				C:/hostedtoolcache/windows/go/1.23.6/x64/src/net/http/server.go:2092
        	            				C:/hostedtoolcache/windows/go/1.23.6/x64/src/runtime/asm_amd64.s:1700
        	Error:      	Condition failed!
        	Test:       	TestDaemonUserAgent
    daemon_test.go:611: 
        	Error Trace:	D:/a/arduino-cli/arduino-cli/internal/integrationtest/daemon/daemon_test.go:611
        	Error:      	Received unexpected error:
        	            	rpc error: code = Internal desc = Some indexes could not be updated.
        	Test:       	TestDaemonUserAgent
--- FAIL: TestDaemonUserAgent (3.21s)

What is the new behavior?

My suspect is that the local webserver (that is started under a go-routine) sometimes is too slow to start, and the UpdateIndex operation fails due to a "connection refused". BTW my try to show the error is probably enough to slow down the test a bit to allow the webserver to go live and make the test pass.
I will keep this debug-print enabled to see the root cause of the failure the next time the test will fail.

Does this PR introduce a breaking change, and is titled accordingly?

Other information

@cmaglie cmaglie self-assigned this Feb 24, 2025
@cmaglie cmaglie added topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project labels Feb 24, 2025
@cmaglie cmaglie marked this pull request as ready for review February 24, 2025 15:48
@cmaglie cmaglie requested a review from a team February 24, 2025 15:48
Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.75%. Comparing base (fff8658) to head (386439d).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2844      +/-   ##
==========================================
- Coverage   67.76%   67.75%   -0.02%     
==========================================
  Files         238      238              
  Lines       22402    22402              
==========================================
- Hits        15181    15178       -3     
- Misses       6029     6031       +2     
- Partials     1192     1193       +1     
Flag Coverage Δ
unit 67.75% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cmaglie cmaglie merged commit 9c49521 into arduino:master Feb 24, 2025
98 checks passed
@cmaglie cmaglie deleted the integration-tests branch February 24, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants